package com.example.sugar.mapper;

import com.example.sugar.bean.ExamOne;
import com.example.sugar.bean.TrafficOne;
import com.example.sugar.bean.TrafficTwo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface TrafficStateMapper {
    @Select("select sum(uv) uv,\n" +
            "sum(session_count) session_count,\n" +
            "sum(page_count)/sum(session_count) pv_per_session,\n" +
            "sum(time_count) / sum(session_count) dur_per_session,\n" +
            " sum(uj) / sum(session_count)   uj_rate\n" +
            " from dws_traffic_page_view \n" +
            "WHERE toYYYYMMDD(stt) = #{date}")
    TrafficOne selectOne(@Param("date") Integer date);

    @Select(" select sum(uv) uv,\n" +
            " sum(session_count) session_count,\n" +
            " sum(page_count)/sum(session_count) pv_per_session\n" +
            " from dws_traffic_page_view \n" +
            "WHERE toYYYYMMDD(stt) = #{date}")
    TrafficTwo selectTwo(@Param("date") Integer date);
}
